import { baseUrl } from "../api/url.config";

export const upload = ({ filePath }) => {
  console.log(filePath);
  return new Promise((resolve, reject) => {
    uni.uploadFile({
      url: baseUrl + "/api/uploads", //仅为示例，非真实的接口地址
      filePath,
      name: "file",
      success: uploadFileRes => {
        console.log(uploadFileRes.data);
        resolve(uploadFileRes);
      }
    });
  });
};
